home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / octa209s.zip / octave-2.09 / doc / interpreter / bugs.tex < prev    next >
Text File  |  1997-08-13  |  18KB  |  476 lines

  1. @c Copyright (C) 1996, 1997 John W. Eaton
  2. @c This is part of the Octave manual.
  3. @c For copying conditions, see the file gpl.tex.
  4.  
  5. @c The text of this file will eventually appear in the file BUGS
  6. @c in the Octave distribution, as well as in the Octave manual.
  7.  
  8. @ifclear BUGSONLY
  9. @node Trouble, Installation, Tips, Top
  10. @appendix Known Causes of Trouble
  11. @end ifclear
  12.  
  13. @ifset BUGSONLY
  14. @include conf.tex
  15.  
  16. This file documents known bugs in Octave and describes where and how to
  17. report any bugs that you may find.
  18.  
  19. Copyright (C) 1996, 1997 John W. Eaton.  You may copy, distribute, and
  20. modify it freely as long as you preserve this copyright notice and
  21. permission notice.
  22.  
  23. @node Trouble,  , Trouble
  24. @chapter Known Causes of Trouble with Octave
  25. @end ifset
  26.  
  27. @cindex bugs, known
  28. @cindex installation trouble
  29. @cindex known causes of trouble
  30. @cindex troubleshooting
  31.  
  32. This section describes known problems that affect users of Octave.  Most
  33. of these are not Octave bugs per se---if they were, we would fix them.
  34. But the result for a user may be like the result of a bug.
  35.  
  36. Some of these problems are due to bugs in other software, some are
  37. missing features that are too much work to add, and some are places
  38. where people's opinions differ as to what is best.
  39.  
  40. @menu
  41. * Actual Bugs::                 Bugs we will fix later.
  42. * Reporting Bugs::              
  43. * Bug Criteria::                
  44. * Bug Lists::                   
  45. * Bug Reporting::               
  46. * Sending Patches::             
  47. * Service::                     
  48. @end menu
  49.  
  50. @node Actual Bugs, Reporting Bugs, Trouble, Trouble
  51. @appendixsec Actual Bugs We Haven't Fixed Yet
  52.  
  53. @itemize @bullet
  54. @item
  55. Output that comes directly from Fortran functions is not sent through
  56. the pager and may appear out of sequence with other output that is sent
  57. through the pager.  One way to avoid this is to force pending output to
  58. be flushed before calling a function that will produce output from
  59. within Fortran functions.  To do this, use the command
  60.  
  61. @example
  62. fflush (stdout)
  63. @end example
  64.  
  65. Another possible workaround is to use the command
  66.  
  67. @example
  68. page_screen_output = "false"
  69. @end example
  70.  
  71. @noindent
  72. to turn the pager off.
  73.  
  74. @item
  75. If you get messages like
  76.  
  77. @example
  78. Input line too long
  79. @end example
  80.  
  81. when trying to plot many lines on one graph, you have probably generated
  82. a plot command that is too larger for @code{gnuplot}'s fixed-length
  83. buffer for commands.  Splitting up the plot command doesn't help because
  84. replot is implemented in gnuplot by simply appending the new plotting
  85. commands to the old command line and then evaluating it again.
  86.  
  87. You can demonstrate this `feature' by running gnuplot and doing
  88. something like
  89.  
  90. @example
  91.   plot sin (x), sin (x), sin (x), ... lots more ..., sin (x)
  92. @end example
  93.  
  94. @noindent
  95. and then
  96.  
  97. @example
  98.   replot sin (x), sin (x), sin (x), ... lots more ..., sin (x)
  99. @end example
  100.  
  101. @noindent
  102. after repeating the replot command a few times, gnuplot will give you
  103. an error.
  104.  
  105. Also, it doesn't help to use backslashes to enter a plot command over
  106. several lines, because the limit is on the overall command line
  107. length, once the backslashed lines are all pasted together.
  108.  
  109. Because of this, Octave tries to use as little of the command-line
  110. length as possible by using the shortest possible abbreviations for
  111. all the plot commands and options.  Unfortunately, the length of the
  112. temporary file names is probably what is taking up the most space on
  113. the command line.
  114.  
  115. You can buy a little bit of command line space by setting the
  116. environment variable @code{TMPDIR} to be "." before starting Octave, or
  117. you can increase the maximum command line length in gnuplot by changing
  118. the following limits in the file plot.h in the gnuplot distribution and
  119. recompiling gnuplot.
  120.  
  121. @example
  122. #define MAX_LINE_LEN 32768  /* originally 1024 */
  123. #define MAX_TOKENS 8192     /* originally 400 */
  124. @end example  
  125.  
  126. Of course, this doesn't really fix the problem, but it does make it
  127. much less likely that you will run into trouble unless you are putting
  128. a very large number of lines on a given plot.
  129. @end itemize
  130.  
  131. A list of ideas for future enhancements is distributed with Octave.  See
  132. the file @file{PROJECTS} in the top level directory in the source
  133. distribution.
  134.  
  135. @node Reporting Bugs, Bug Criteria, Actual Bugs, Trouble
  136. @appendixsec Reporting Bugs
  137. @cindex bugs
  138. @cindex reporting bugs
  139.  
  140. Your bug reports play an essential role in making Octave reliable.
  141.  
  142. When you encounter a problem, the first thing to do is to see if it is
  143. already known.  @xref{Trouble}.  If it isn't known, then you should
  144. report the problem.
  145.  
  146. Reporting a bug may help you by bringing a solution to your problem, or
  147. it may not.  In any case, the principal function of a bug report is
  148. to help the entire community by making the next version of Octave work
  149. better.  Bug reports are your contribution to the maintenance of Octave.
  150.  
  151. In order for a bug report to serve its purpose, you must include the
  152. information that makes it possible to fix the bug.
  153.  
  154. @findex bug_report
  155.  
  156. If you have Octave working at all, the easiest way to prepare a complete
  157. bug report is to use the Octave function @code{bug_report}.  When you
  158. execute this function, Octave will prompt you for a subject and then
  159. invoke the editor on a file that already contains all the configuration
  160. information.  When you exit the editor, Octave will mail the bug report
  161. for you.
  162.  
  163. @menu
  164. * Bug Criteria::                
  165. * Where: Bug Lists.             Where to send your bug report.
  166. * Reporting: Bug Reporting.     How to report a bug effectively.
  167. * Patches: Sending Patches.     How to send a patch for Octave.
  168. @end menu
  169.  
  170. @node Bug Criteria, Bug Lists, Reporting Bugs, Trouble
  171. @appendixsec Have You Found a Bug?
  172. @cindex bug criteria
  173.  
  174. If you are not sure whether you have found a bug, here are some guidelines:
  175.  
  176. @itemize @bullet
  177. @cindex fatal signal
  178. @cindex core dump
  179. @item
  180. If Octave gets a fatal signal, for any input whatever, that is
  181. a bug.  Reliable interpreters never crash.
  182.  
  183. @cindex incorrect output
  184. @cindex incorrect results
  185. @cindex results, incorrect
  186. @cindex answers, incorrect
  187. @cindex erroneous results
  188. @cindex wrong answers
  189. @item
  190. If Octave produces incorrect results, for any input whatever,
  191. that is a bug.
  192.  
  193. @cindex undefined behavior
  194. @cindex undefined function value
  195. @item
  196. Some output may appear to be incorrect when it is in fact due to a
  197. program whose behavior is undefined, which happened by chance to give
  198. the desired results on another system.  For example, the range operator
  199. may produce different results because of differences in the way floating
  200. point arithmetic is handled on various systems.
  201.  
  202. @cindex erroneous messages
  203. @cindex incorrect error messages
  204. @cindex error messages, incorrect
  205. @item
  206. If Octave produces an error message for valid input, that is a bug.
  207.  
  208. @cindex invalid input
  209. @item
  210. If Octave does not produce an error message for invalid input, that is
  211. a bug.  However, you should note that your idea of ``invalid input''
  212. might be my idea of ``an extension'' or ``support for traditional
  213. practice''.
  214.  
  215. @cindex improving Octave
  216. @cindex suggestions
  217. @item
  218. If you are an experienced user of programs like Octave, your suggestions
  219. for improvement are welcome in any case.
  220. @end itemize
  221.  
  222. @node Bug Lists, Bug Reporting, Bug Criteria, Trouble
  223. @appendixsec Where to Report Bugs
  224. @cindex bug report mailing lists
  225. @cindex reporting bugs
  226. @cindex bugs, reporting
  227.  
  228. @findex bug_report
  229.  
  230. If you have Octave working at all, the easiest way to prepare a complete
  231. bug report is to use the Octave function @code{bug_report}.  When you
  232. execute this function, Octave will prompt you for a subject and then
  233. invoke the editor on a file that already contains all the configuration
  234. information.  When you exit the editor, Octave will mail the bug report
  235. for you.
  236.  
  237. If for some reason you cannot use Octave's @code{bug_report} function,
  238. send bug reports for Octave to @email{bug-octave@@bevo.che.wisc.edu}.
  239.  
  240. @strong{Do not send bug reports to @samp{help-octave}}.  Most users of
  241. Octave do not want to receive bug reports.  Those that do have asked to
  242. be on the mailing list.
  243.  
  244. As a last resort, send bug reports on paper to:
  245.  
  246. @example
  247. Octave Bugs c/o John W. Eaton
  248. University of Wisconsin-Madison
  249. Department of Chemical Engineering
  250. 1415 Engineering Drive
  251. Madison, Wisconsin 53706  USA
  252. @end example
  253.  
  254. @node Bug Reporting, Sending Patches, Bug Lists, Trouble
  255. @appendixsec How to Report Bugs
  256. @cindex bugs, reporting
  257.  
  258. Send bug reports for Octave to one of the addresses listed in
  259. @ref{Bug Lists}.
  260.  
  261. The fundamental principle of reporting bugs usefully is this:
  262. @strong{report all the facts}.  If you are not sure whether to state a
  263. fact or leave it out, state it!
  264.  
  265. Often people omit facts because they think they know what causes the
  266. problem and they conclude that some details don't matter.  Thus, you might
  267. assume that the name of the variable you use in an example does not matter.
  268. Well, probably it doesn't, but one cannot be sure.  Perhaps the bug is a
  269. stray memory reference which happens to fetch from the location where that
  270. name is stored in memory; perhaps, if the name were different, the contents
  271. of that location would fool the interpreter into doing the right thing
  272. despite the bug.  Play it safe and give a specific, complete example.
  273.  
  274. Keep in mind that the purpose of a bug report is to enable someone to
  275. fix the bug if it is not known. Always write your bug reports on
  276. the assumption that the bug is not known.
  277.  
  278. Sometimes people give a few sketchy facts and ask, ``Does this ring a
  279. bell?''  This cannot help us fix a bug.  It is better to send a complete
  280. bug report to begin with.
  281.  
  282. Try to make your bug report self-contained.  If we have to ask you for
  283. more information, it is best if you include all the previous information
  284. in your response, as well as the information that was missing.
  285.  
  286. To enable someone to investigate the bug, you should include all these
  287. things:
  288.  
  289. @itemize @bullet
  290. @item
  291. The version of Octave.  You can get this by noting the version number
  292. that is printed when Octave starts, or running it with the @samp{-v}
  293. option.
  294.  
  295. @item
  296. A complete input file that will reproduce the bug.
  297.  
  298. A single statement may not be enough of an example---the bug might
  299. depend on other details that are missing from the single statement where
  300. the error finally occurs.
  301.  
  302. @item
  303. The command arguments you gave Octave to execute that example
  304. and observe the bug.  To guarantee you won't omit something important,
  305. list all the options. 
  306.  
  307. If we were to try to guess the arguments, we would probably guess wrong
  308. and then we would not encounter the bug.
  309.  
  310. @item
  311. The type of machine you are using, and the operating system name and
  312. version number.
  313.  
  314. @item
  315. The command-line arguments you gave to the @code{configure} command when
  316. you installed the interpreter.
  317.  
  318. @item
  319. A complete list of any modifications you have made to the interpreter
  320. source.
  321.  
  322. Be precise about these changes---show a context diff for them.
  323.  
  324. @item
  325. Details of any other deviations from the standard procedure for installing
  326. Octave.
  327.  
  328. @cindex incorrect output
  329. @cindex incorrect results
  330. @cindex results, incorrect
  331. @cindex answers, incorrect
  332. @cindex erroneous results
  333. @cindex wrong answers
  334. @item
  335. A description of what behavior you observe that you believe is
  336. incorrect.  For example, "The interpreter gets a fatal signal," or, "The
  337. output produced at line 208 is incorrect."
  338.  
  339. Of course, if the bug is that the interpreter gets a fatal signal, then
  340. one can't miss it.  But if the bug is incorrect output, we might not
  341. notice unless it is glaringly wrong.
  342.  
  343. Even if the problem you experience is a fatal signal, you should still
  344. say so explicitly.  Suppose something strange is going on, such as, your
  345. copy of the interpreter is out of synch, or you have encountered a bug
  346. in the C library on your system.  Your copy might crash and the copy
  347. here would not.  If you said to expect a crash, then when the
  348. interpreter here fails to crash, we would know that the bug was not
  349. happening.  If you don't say to expect a crash, then we would not know
  350. whether the bug was happening.  We would not be able to draw any
  351. conclusion from our observations.
  352.  
  353. Often the observed symptom is incorrect output when your program is run.
  354. Unfortunately, this is not enough information unless the program is
  355. short and simple.  It is very helpful if you can include an explanation
  356. of the expected output, and why the actual output is incorrect.
  357.  
  358. @item
  359. If you wish to suggest changes to the Octave source, send them as
  360. context diffs.  If you even discuss something in the Octave source,
  361. refer to it by context, not by line number, because the line numbers in
  362. the development sources probably won't match those in your sources.
  363. @end itemize
  364.  
  365. Here are some things that are not necessary:
  366.  
  367. @itemize @bullet
  368. @cindex bugs, investigating
  369. @item
  370. A description of the envelope of the bug.
  371.  
  372. Often people who encounter a bug spend a lot of time investigating which
  373. changes to the input file will make the bug go away and which changes
  374. will not affect it.  Such information is usually not necessary to enable
  375. us to fix bugs in Octave, but if you can find a simpler example to
  376. report @emph{instead} of the original one, that is a convenience.
  377. Errors in the output will be easier to spot, running under the debugger
  378. will take less time, etc. Most Octave bugs involve just one function, so
  379. the most straightforward way to simplify an example is to delete all the
  380. function definitions except the one in which the bug occurs.
  381.  
  382. However, simplification is not vital; if you don't want to do
  383. this, report the bug anyway and send the entire test case you
  384. used.
  385.  
  386. @item
  387. A patch for the bug.  Patches can be helpful, but if you find a bug, you
  388. should report it, even if you cannot send a fix for the problem.
  389. @end itemize
  390.  
  391. @node Sending Patches, Service, Bug Reporting, Trouble
  392. @appendixsec Sending Patches for Octave
  393. @cindex improving Octave
  394. @cindex diffs, submitting
  395. @cindex patches, submitting
  396. @cindex submitting diffs
  397. @cindex submitting patches
  398.  
  399. If you would like to write bug fixes or improvements for Octave, that is
  400. very helpful.  When you send your changes, please follow these
  401. guidelines to avoid causing extra work for us in studying the patches.
  402.  
  403. If you don't follow these guidelines, your information might still be
  404. useful, but using it will take extra work.  Maintaining Octave is a lot
  405. of work in the best of circumstances, and we can't keep up unless you do
  406. your best to help.
  407.  
  408. @itemize @bullet
  409. @item
  410. Send an explanation with your changes of what problem they fix or what
  411. improvement they bring about.  For a bug fix, just include a copy of the
  412. bug report, and explain why the change fixes the bug.
  413.  
  414. @item
  415. Always include a proper bug report for the problem you think you have
  416. fixed.  We need to convince ourselves that the change is right before
  417. installing it.  Even if it is right, we might have trouble judging it if
  418. we don't have a way to reproduce the problem.
  419.  
  420. @item
  421. Include all the comments that are appropriate to help people reading the
  422. source in the future understand why this change was needed.
  423.  
  424. @item
  425. Don't mix together changes made for different reasons.
  426. Send them @emph{individually}.
  427.  
  428. If you make two changes for separate reasons, then we might not want to
  429. install them both.  We might want to install just one.
  430.  
  431. @item
  432. Use @samp{diff -c} to make your diffs.  Diffs without context are hard
  433. for us to install reliably.  More than that, they make it hard for us to
  434. study the diffs to decide whether we want to install them.  Unidiff
  435. format is better than contextless diffs, but not as easy to read as
  436. @samp{-c} format.
  437.  
  438. If you have GNU diff, use @samp{diff -cp}, which shows the name of the
  439. function that each change occurs in.
  440.  
  441. @item
  442. Write the change log entries for your changes.
  443.  
  444. Read the @file{ChangeLog} file to see what sorts of information to put
  445. in, and to learn the style that we use.  The purpose of the change log
  446. is to show people where to find what was changed.  So you need to be
  447. specific about what functions you changed; in large functions, it's
  448. often helpful to indicate where within the function the change was made.
  449.  
  450. On the other hand, once you have shown people where to find the change,
  451. you need not explain its purpose. Thus, if you add a new function, all
  452. you need to say about it is that it is new.  If you feel that the
  453. purpose needs explaining, it probably does---but the explanation will be
  454. much more useful if you put it in comments in the code.
  455.  
  456. If you would like your name to appear in the header line for who made
  457. the change, send us the header line.
  458. @end itemize
  459.  
  460. @node Service,  , Sending Patches, Trouble
  461. @appendixsec How To Get Help with Octave
  462. @cindex help, where to find
  463.  
  464. The mailing list @email{help-octave@@bevo.che.wisc.edu} exists for the
  465. discussion of matters related to using and installing Octave.  If would
  466. like to join the discussion, please send a short note to
  467. @email{help-octave@strong{-request}@@bevo.che.wisc.edu}.
  468.  
  469. @strong{Please do not} send requests to be added or removed from the the
  470. mailing list, or other administrative trivia to the list itself.
  471.  
  472. If you think you have found a bug in the installation procedure,
  473. however, you should send a complete bug report for the problem to
  474. @email{bug-octave@@bevo.che.wisc.edu}.  @xref{Bug Reporting} for
  475. information that will help you to submit a useful report.
  476.